<table>
    <thead>
        <tr>
        	<g:sortableColumn property="contract" title="${message(code: 'b2b.contractDetail.contract.label', default: 'Contract')}" />
            <g:sortableColumn property="serialNumber" title="${message(code: 'b2b.contractDetail.serialNumber.label', default: 'Serial Number')}" />
            <g:sortableColumn property="family" title="${message(code: 'b2b.contractDetail.family.label', default: 'Family')}" />
            <g:sortableColumn property="discount" title="${message(code: 'b2b.contractDetail.discount.label', default: 'Discount')}" />
            <g:sortableColumn property="specialDiscount" title="${message(code: 'b2b.contractDetail.specialDiscount.label', default: 'Special Discount')}" />
            <g:sortableColumn property="finalDiscount" title="${message(code: 'b2b.contractDetail.finalDiscount.label', default: 'Final Discount')}" />
        </tr>
    </thead>
    <tbody>
    <g:each in="${contractDetailInstanceList}" status="i" var="contractDetailInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
        	<td><g:link controller="contract" action="show" id="${contractDetailInstance.contract.id}">${fieldValue(bean: contractDetailInstance, field: "contract")}</g:link></td>
            <td><g:link action="show" id="${contractDetailInstance.id}">${fieldValue(bean: contractDetailInstance, field: "serialNumber")}</g:link></td>
            <td>${fieldValue(bean: contractDetailInstance, field: "family")}</td>
            <td><g:formatNumber number="${contractDetailInstance?.discount}" format="###,##0.00%" /></td>
            <td><g:formatNumber number="${contractDetailInstance?.specialDiscount}" format="###,##0.00%" /></td>
            <td><g:formatNumber number="${contractDetailInstance?.finalDiscount}" format="###,##0.00%" /></td>
        </tr>
    </g:each>
    </tbody>
</table>